<?php 
class FeaturedProducts extends CWidget {
	public $model = array();
	
	public function init(){
		$this->model = $this->getFeaturedProducts();

		parent::init();
	}
	
	public function getFeaturedProducts() {
		$model = Products::model()->getFeaturedProducts(0, 2);

		return $model;
	}
	
	public function run(){

		$this->render('featured-products',array(
			'model' => $this->model,
		));
	}
}
?>
